<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">




<title>DotNet Framework源代码中的模式（八）——Builder（生成器模式） - Guushuuse .NET - 博客园</title>
<meta name="keywords" content="Pattern">



<link title="RSS" type="application/rss+xml" rel="alternate" href="http://www.cnblogs.com/guushuuse/rss">
<link title="RSD" type="application/rsd+xml" rel="EditURI" href="http://www.cnblogs.com/guushuuse/rsd.xml"> 
  



<link rel="stylesheet" type="text/css" href="index.css" media="all">
</head>
<body>
    <form name="Form1" method="post" action="http://www.cnblogs.com/guushuuse/archive/2009/05/17/1458928.html" id="Form1">
<div>
<input name="__EVENTTARGET" id="__EVENTTARGET" value="" type="hidden">
<input name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" type="hidden">
<input name="__VIEWSTATE" id="__VIEWSTATE" value="" type="hidden">
</div>




        
<h1><a id="Header1_HeaderTitle" class="headermaintitle" href="http://www.cnblogs.com/guushuuse/">Guushuuse .NET</a></h1>
<p id="tagline">一直专注于企业应用开发。
5~9——原创随笔
</p>
<div id="rigthtag">&nbsp;</div>
			<div id="main">
				
					
	<div class="post">
		<h2>
			<a id="ctl04_TitleUrl" href="http://www.cnblogs.com/guushuuse/archive/2009/05/17/1458928.html">DotNet Framework源代码中的模式（八）——Builder（生成器模式）</a>
		</h2>
		<p>&nbsp; </p>
<p style="text-indent: 21pt;"><span style="font-family: 宋体;">将一个复杂对象的构件与它的表示分离，使得同样的构建过程可以创建不同的表述。</span></p>
<p><img alt="" src="2009051701.jpg" border="0" height="188" width="433">&nbsp; </p>
<p style="text-indent: 21pt;"><span style="font-family: 宋体;">建造者（</span>Builder<span style="font-family: 宋体;">）角色：给出一个抽象接口，以规范产品对象的各个组成成分的建造。一般而言，此接口独立于应用程序的商业逻辑。模式中直接创建产品对象的是具体建造者（</span>ConcreteBuilder<span style="font-family: 宋体;">）角色。具体建造者类必须实现这个接口所要求的方法：一个是建造方法，另一个是结果返还方法。</span></p>
<p style="text-indent: 21pt;"><span style="font-family: 宋体;">具体建造者（</span>Concrete Builder<span style="font-family: 宋体;">）角色：担任这个角色的是于应用程序紧密相关的类，它们在应用程序调用下创建产品实例。这个角色主要完成的任务包括：实现</span>Builder<span style="font-family: 宋体;">角色提供的接口，一步一步完成创建产品实例的过程；在建造过程完成后，提供产品的实例。</span> </p>
<p style="text-indent: 21pt;"><span style="font-family: 宋体;">指导者（</span>Director<span style="font-family: 宋体;">）角色：担任这个角色的类调用具体建造者角色以创建产品对象。导演者并没有产品类的具体知识，真正拥有产品类的具体知识的是具体建造者对象。</span></p>
<p style="text-indent: 21pt;"><span style="font-family: 宋体;">产品（</span>Product<span style="font-family: 宋体;">）角色：产品便是建造中的复杂对象。</span></p>
<p style="text-indent: 21pt;">&nbsp;</p>
<p><span style="font-family: 宋体;">以以</span>.NET Framework 2.0 System.Text. StringBuilder<span style="font-family: 宋体;">为例</span></p>
<p><span style="font-family: 宋体;"><img alt="" src="2009051702.jpg" border="0" height="76" width="460"></span><span style="font-family: 宋体;">&nbsp; </span></p>
<p style="text-indent: 21pt;">System.Text. StringBuilder</p>
<p style="text-indent: 21pt;">&nbsp;</p>
<div class="cnblogs_code"><img style="display: none;" id="Code_Closed_Image_194212" onclick="this.style.display='none'; document.getElementById('Code_Closed_Text_194212').style.display='none'; document.getElementById('Code_Open_Image_194212').style.display='inline'; document.getElementById('Code_Open_Text_194212').style.display='inline';" src="contractedblock.gif" align="top" height="16" width="11"><img id="Code_Open_Image_194212" style="display: inline;" onclick="this.style.display='none'; document.getElementById('Code_Open_Text_194212').style.display='none'; getElementById('Code_Closed_Image_194212').style.display='inline'; getElementById('Code_Closed_Text_194212').style.display='inline';" src="expandedblockstart.gif" align="top" height="16" width="11"><span style="display: none;" class="cnblogs_code_Collapse" id="Code_Closed_Text_194212">Code</span><span id="Code_Open_Text_194212" style="display: inline;"><br>
<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">sealed</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">&nbsp;StringBuilder&nbsp;:&nbsp;ISerializable<br>
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"><img src="dot.gif" alt=""><img src="dot.gif" alt=""></span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">internal</span><span style="color: rgb(0, 0, 0);">&nbsp;IntPtr&nbsp;m_currentThread&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;Thread.InternalGetCurrentThread();<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">internal</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;m_MaxCapacity&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(128, 0, 128);">0</span><span style="color: rgb(0, 0, 0);">;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">internal</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">volatile</span><span style="color: rgb(0, 0, 0);">&nbsp;String&nbsp;m_StringValue&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"><img src="dot.gif" alt=""><img src="dot.gif" alt=""></span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;StringBuilder()&nbsp;:&nbsp;</span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">(DefaultCapacity)<br>
&nbsp;&nbsp;&nbsp;&nbsp;{<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"><img src="dot.gif" alt=""><img src="dot.gif" alt=""></span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;StringBuilder&nbsp;Append(String&nbsp;value)<br>
&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">If&nbsp;the&nbsp;value&nbsp;being&nbsp;added&nbsp;is&nbsp;null,&nbsp;eat&nbsp;the&nbsp;null<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">and&nbsp;return.&nbsp;</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">&nbsp;(value&nbsp;</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IntPtr&nbsp;tid;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;hand&nbsp;inlining&nbsp;of&nbsp;GetThreadSafeString&nbsp;</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;currentString&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;m_StringValue;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tid&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;Thread.InternalGetCurrentThread();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">&nbsp;(m_currentThread&nbsp;</span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);">&nbsp;tid)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;currentString&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;String.GetStringForStringBuilder(currentString,&nbsp;currentString.Capacity);<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;currentLength&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;currentString.Length;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;requiredLength&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;currentLength&nbsp;</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">&nbsp;value.Length;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">&nbsp;(NeedsAllocation(currentString,&nbsp;requiredLength))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;newString&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;GetNewString(currentString,&nbsp;requiredLength);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newString.AppendInPlace(value,&nbsp;currentLength);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ReplaceString(tid,&nbsp;newString);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;currentString.AppendInPlace(value,&nbsp;currentLength);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ReplaceString(tid,&nbsp;currentString);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"><img src="dot.gif" alt=""><img src="dot.gif" alt=""></span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;StringBuilder&nbsp;Append(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;value)<br>
&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;Append(value.ToString(CultureInfo.CurrentCulture));<br>
&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"><img src="dot.gif" alt=""><img src="dot.gif" alt=""></span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">override</span><span style="color: rgb(0, 0, 0);">&nbsp;String&nbsp;ToString()<br>
&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;We&nbsp;assume&nbsp;that&nbsp;their&nbsp;read&nbsp;of&nbsp;m_currentThread&nbsp;will&nbsp;always&nbsp;occur&nbsp;after&nbsp;read&nbsp;of&nbsp;m_StringValue.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;If&nbsp;these&nbsp;reads&nbsp;get&nbsp;re-ordered&nbsp;then&nbsp;it&nbsp;is&nbsp;possible&nbsp;to&nbsp;get&nbsp;a&nbsp;currentString&nbsp;owned&nbsp;by&nbsp;some&nbsp;other&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;(mutating)&nbsp;thread&nbsp;and&nbsp;yet&nbsp;think,&nbsp;according&nbsp;to&nbsp;currentThread,&nbsp;that&nbsp;such&nbsp;was&nbsp;not&nbsp;the&nbsp;case.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;This&nbsp;is&nbsp;acheived&nbsp;by&nbsp;marking&nbsp;m_StringValue&nbsp;as&nbsp;volatile.&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;currentString&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;m_StringValue;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IntPtr&nbsp;currentThread&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;m_currentThread;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;Note&nbsp;calling&nbsp;ToString&nbsp;the&nbsp;second&nbsp;time&nbsp;or&nbsp;from&nbsp;a&nbsp;different&nbsp;thread&nbsp;will&nbsp;cause&nbsp;allocation&nbsp;of&nbsp;a&nbsp;new&nbsp;string.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;If&nbsp;we&nbsp;do&nbsp;not&nbsp;make&nbsp;a&nbsp;copy&nbsp;if&nbsp;currentThread&nbsp;is&nbsp;IntPtr.Zero,&nbsp;we&nbsp;will&nbsp;have&nbsp;following&nbsp;race:&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;(1)&nbsp;Thread&nbsp;T1&nbsp;completes&nbsp;a&nbsp;mutation&nbsp;of&nbsp;the&nbsp;string&nbsp;and&nbsp;will&nbsp;become&nbsp;the&nbsp;owner.&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;T1&nbsp;then&nbsp;starts&nbsp;another&nbsp;mutation&nbsp;operation&nbsp;and&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;A&nbsp;thread&nbsp;interleaving&nbsp;happens&nbsp;at&nbsp;this&nbsp;point.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;(2)&nbsp;Thread&nbsp;T2&nbsp;starts&nbsp;a&nbsp;ToString&nbsp;operation.&nbsp;&nbsp;T2&nbsp;reads&nbsp;m_StringValue&nbsp;into&nbsp;its&nbsp;local&nbsp;currentString&nbsp;variable.&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;A&nbsp;thread&nbsp;interleaving&nbsp;happens&nbsp;at&nbsp;this&nbsp;point.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;(3)&nbsp;Thread&nbsp;T3&nbsp;finshes&nbsp;a&nbsp;mutation&nbsp;of&nbsp;the&nbsp;string&nbsp;in&nbsp;the&nbsp;StringBuilder&nbsp;,&nbsp;performing&nbsp;the&nbsp;ReplaceString&nbsp;call.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;Thread&nbsp;T3&nbsp;then&nbsp;starts&nbsp;a&nbsp;ToString&nbsp;operation.&nbsp;&nbsp;Assuming&nbsp;the&nbsp;string&nbsp;is&nbsp;not&nbsp;wasting&nbsp;excessive&nbsp;space,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;T3&nbsp;will&nbsp;proceeds&nbsp;to&nbsp;call&nbsp;ClearPostNullChar,&nbsp;registers&nbsp;NOBODY&nbsp;as&nbsp;the&nbsp;owner,&nbsp;and&nbsp;returns&nbsp;the&nbsp;string.&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;A&nbsp;thread&nbsp;interleaving&nbsp;happens&nbsp;at&nbsp;this&nbsp;point.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;(4)&nbsp;Thread&nbsp;T2&nbsp;resumes&nbsp;execution.&nbsp;&nbsp;T2&nbsp;reads&nbsp;m_currentThread&nbsp;and&nbsp;sees&nbsp;that&nbsp;NOBODY&nbsp;is&nbsp;the&nbsp;registered&nbsp;owner&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;&nbsp;Assuming&nbsp;its&nbsp;currentString&nbsp;is&nbsp;not&nbsp;wasting&nbsp;excessive&nbsp;space,&nbsp;T2&nbsp;will&nbsp;return&nbsp;the&nbsp;same&nbsp;string&nbsp;that&nbsp;thread&nbsp;T1&nbsp;is&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;&nbsp;in&nbsp;the&nbsp;middle&nbsp;of&nbsp;mutating.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">&nbsp;(currentThread&nbsp;</span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);">&nbsp;Thread.InternalGetCurrentThread())<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;String.InternalCopy(currentString);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">&nbsp;((</span><span style="color: rgb(128, 0, 128);">2</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">&nbsp;currentString.Length)&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">&nbsp;currentString.ArrayLength)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;String.InternalCopy(currentString);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;currentString.ClearPostNullChar();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_currentThread&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;IntPtr.Zero;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;currentString;<br>
&nbsp;&nbsp;&nbsp;&nbsp;}<br>
}<br>
</span></span></div>
<p>&nbsp;</p>
<p style="text-indent: 21pt;">System.String</p>
<div class="cnblogs_code"><img style="display: none;" id="Code_Closed_Image_194255" onclick="this.style.display='none'; document.getElementById('Code_Closed_Text_194255').style.display='none'; document.getElementById('Code_Open_Image_194255').style.display='inline'; document.getElementById('Code_Open_Text_194255').style.display='inline';" src="contractedblock.gif" align="top" height="16" width="11"><img id="Code_Open_Image_194255" style="display: inline;" onclick="this.style.display='none'; document.getElementById('Code_Open_Text_194255').style.display='none'; getElementById('Code_Closed_Image_194255').style.display='inline'; getElementById('Code_Closed_Text_194255').style.display='inline';" src="expandedblockstart.gif" align="top" height="16" width="11"><span style="display: none;" class="cnblogs_code_Collapse" id="Code_Closed_Text_194255">Code</span><span id="Code_Open_Text_194255" style="display: inline;"><br>
<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">sealed</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">&nbsp;String&nbsp;:&nbsp;IComparable,&nbsp;ICloneable,&nbsp;IConvertible,&nbsp;IEnumerable<br>
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"><img src="dot.gif" alt=""><img src="dot.gif" alt=""><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;Creates&nbsp;a&nbsp;new&nbsp;string&nbsp;with&nbsp;the&nbsp;characters&nbsp;copied&nbsp;in&nbsp;from&nbsp;ptr.&nbsp;If&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;ptr&nbsp;is&nbsp;null,&nbsp;a&nbsp;string&nbsp;initialized&nbsp;to&nbsp;";&lt;;No&nbsp;Object&gt;;";&nbsp;(i.e.,&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;String.NullString)&nbsp;is&nbsp;created.<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;[CLSCompliant(</span><span style="color: rgb(0, 0, 255);">false</span><span style="color: rgb(0, 0, 0);">),&nbsp;MethodImplAttribute(MethodImplOptions.InternalCall)]<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">unsafe</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">extern</span><span style="color: rgb(0, 0, 0);">&nbsp;String(</span><span style="color: rgb(0, 0, 255);">char</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">&nbsp;value);<br>
&nbsp;&nbsp;&nbsp;&nbsp;[CLSCompliant(</span><span style="color: rgb(0, 0, 255);">false</span><span style="color: rgb(0, 0, 0);">),&nbsp;MethodImplAttribute(MethodImplOptions.InternalCall)]<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">unsafe</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">extern</span><span style="color: rgb(0, 0, 0);">&nbsp;String(</span><span style="color: rgb(0, 0, 255);">char</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">&nbsp;value,&nbsp;</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;startIndex,&nbsp;</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;length);<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;[CLSCompliant(</span><span style="color: rgb(0, 0, 255);">false</span><span style="color: rgb(0, 0, 0);">),&nbsp;MethodImplAttribute(MethodImplOptions.InternalCall)]<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">unsafe</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">extern</span><span style="color: rgb(0, 0, 0);">&nbsp;String(</span><span style="color: rgb(0, 0, 255);">sbyte</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">&nbsp;value);<br>
&nbsp;&nbsp;&nbsp;&nbsp;[CLSCompliant(</span><span style="color: rgb(0, 0, 255);">false</span><span style="color: rgb(0, 0, 0);">),&nbsp;MethodImplAttribute(MethodImplOptions.InternalCall)]<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">unsafe</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">extern</span><span style="color: rgb(0, 0, 0);">&nbsp;String(</span><span style="color: rgb(0, 0, 255);">sbyte</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">&nbsp;value,&nbsp;</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;startIndex,&nbsp;</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;length);<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;[CLSCompliant(</span><span style="color: rgb(0, 0, 255);">false</span><span style="color: rgb(0, 0, 0);">),&nbsp;MethodImplAttribute(MethodImplOptions.InternalCall)]<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">unsafe</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">extern</span><span style="color: rgb(0, 0, 0);">&nbsp;String(</span><span style="color: rgb(0, 0, 255);">sbyte</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">&nbsp;value,&nbsp;</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;startIndex,&nbsp;</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;length,&nbsp;Encoding&nbsp;enc);<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"><img src="dot.gif" alt=""><img src="dot.gif" alt=""><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;Creates&nbsp;a&nbsp;new&nbsp;string&nbsp;from&nbsp;the&nbsp;characters&nbsp;in&nbsp;a&nbsp;subarray.&nbsp;&nbsp;The&nbsp;new&nbsp;string&nbsp;will<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;be&nbsp;created&nbsp;from&nbsp;the&nbsp;characters&nbsp;in&nbsp;value&nbsp;between&nbsp;startIndex&nbsp;and<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;startIndex&nbsp;+&nbsp;length&nbsp;-&nbsp;1.&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//<br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;[MethodImplAttribute(MethodImplOptions.InternalCall)]<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">extern</span><span style="color: rgb(0, 0, 0);">&nbsp;String(</span><span style="color: rgb(0, 0, 255);">char</span><span style="color: rgb(0, 0, 0);">[]&nbsp;value,&nbsp;</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;startIndex,&nbsp;</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;length);<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;Creates&nbsp;a&nbsp;new&nbsp;string&nbsp;from&nbsp;the&nbsp;characters&nbsp;in&nbsp;a&nbsp;subarray.&nbsp;&nbsp;The&nbsp;new&nbsp;string&nbsp;will&nbsp;be&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;created&nbsp;from&nbsp;the&nbsp;characters&nbsp;in&nbsp;value.<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//<br>
</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;[MethodImplAttribute(MethodImplOptions.InternalCall)]<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">extern</span><span style="color: rgb(0, 0, 0);">&nbsp;String(</span><span style="color: rgb(0, 0, 255);">char</span><span style="color: rgb(0, 0, 0);">[]&nbsp;value);<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"><img src="dot.gif" alt=""><img src="dot.gif" alt=""></span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">internal</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">unsafe</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">&nbsp;AppendInPlace(String&nbsp;value,&nbsp;</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;currentLength)<br>
&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;count&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;value.Length;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;newLength&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;currentLength&nbsp;</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">&nbsp;count;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"><img src="dot.gif" alt=""><img src="dot.gif" alt=""></span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">fixed</span><span style="color: rgb(0, 0, 0);">&nbsp;(</span><span style="color: rgb(0, 0, 255);">char</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">&nbsp;dest&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">&amp;</span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.m_firstChar)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">fixed</span><span style="color: rgb(0, 0, 0);">&nbsp;(</span><span style="color: rgb(0, 0, 255);">char</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">&nbsp;src&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">&amp;</span><span style="color: rgb(0, 0, 0);">value.m_firstChar)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wstrcpy(dest&nbsp;</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">&nbsp;currentLength,&nbsp;src,&nbsp;count);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dest[newLength]&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">\0</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.m_stringLength&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;newLength;<br>
&nbsp;&nbsp;&nbsp;&nbsp;}<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"><img src="dot.gif" alt=""><img src="dot.gif" alt=""></span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);"><br>
}<br>
</span></span></div>
<p>&nbsp; </p>
<p style="text-indent: 21pt;"><span style="font-family: 宋体;">调用代码</span><span style="font-family: 宋体;"></span></p>
<div class="cnblogs_code"><img style="display: none;" id="Code_Closed_Image_194327" onclick="this.style.display='none'; document.getElementById('Code_Closed_Text_194327').style.display='none'; document.getElementById('Code_Open_Image_194327').style.display='inline'; document.getElementById('Code_Open_Text_194327').style.display='inline';" src="contractedblock.gif" align="top" height="16" width="11"><img id="Code_Open_Image_194327" style="display: inline;" onclick="this.style.display='none'; document.getElementById('Code_Open_Text_194327').style.display='none'; getElementById('Code_Closed_Image_194327').style.display='inline'; getElementById('Code_Closed_Text_194327').style.display='inline';" src="expandedblockstart.gif" align="top" height="16" width="11"><span style="display: none;" class="cnblogs_code_Collapse" id="Code_Closed_Text_194327">Code</span><span id="Code_Open_Text_194327" style="display: inline;"><br>
<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">&nbsp;Client<br>
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">&nbsp;Main()<br>
&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StringBuilder&nbsp;sb&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;StringBuilder();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sb.Append(</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 0, 0);">Hello</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sb.Append(</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 0, 0);">&nbsp;World</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sb.Append(</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 0, 0);">!</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;s&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;sb.ToString();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.Write(s);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.ReadLine();<br>
&nbsp;&nbsp;&nbsp;&nbsp;}<br>
}<br>
</span></span></div>
<p>&nbsp; </p>
<p style="text-indent: 21pt;"><span style="font-family: 宋体;">由于</span>String<span style="font-family: 宋体;">类型代表的是一个不可变的字符串，所以</span>BCL<span style="font-family: 宋体;">提供了另一个名为</span>System.Text.StringBuilder<span style="font-family: 宋体;">的类型，它允许我们有效的对字符串的字符执行动态操作，以创建一个</span>String<span style="font-family: 宋体;">。从逻辑上说，</span>StringBuilder<span style="font-family: 宋体;">对象中包含一个字段，它引用由</span>Char<span style="font-family: 宋体;">结构构成的一个数组。</span>StringBuilder<span style="font-family: 宋体;">的成员允许我们操作这个字符，有效的缩减字符串的大小或者更改字符串中的字符。如果字符串变大，超过已经分配的字符的大小，</span>StringBuilder<span style="font-family: 宋体;">就会自动的分配一个全新的、更大的数组，并开始使用新的数组，前一个数组会被垃圾回收器回收。用</span>StringBuilder<span style="font-family: 宋体;">对象构建好字符串之后，为了将</span>StringBuilder<span style="font-family: 宋体;">的字符“转换”成一个</span>String<span style="font-family: 宋体;">，只需调用</span>StringBuilder<span style="font-family: 宋体;">的</span>ToString<span style="font-family: 宋体;">方法，在内部，该方法只是返回对</span>StringBuilder<span style="font-family: 宋体;">内部维护的字符串的字段的一个引用，执行效率非常快，因为它不需要进行字符数组复制。</span></p>
<p style="text-indent: 21pt;">C#<span style="font-family: 宋体;">中</span>volatile <span style="font-family: 宋体;">关键字指示一个字段可以由多个同时执行的线程修改。声明为</span> volatile <span style="font-family: 宋体;">的字段不受编译器优化（假定由单个线程访问）的限制。这样可以确保该字段在任何时间呈现的都是最新的值。可变关键字仅可应用于类或结构字段。不能将局部变量声明为</span> volatile<span style="font-family: 宋体;">。</span></p>
<p style="text-indent: 21pt;">StringBuilder<span style="font-family: 宋体;">既是具体建造者（</span>Builder<span style="font-family: 宋体;">）又是指导者（</span>Director<span style="font-family: 宋体;">），最终生成一个复杂的</span>String<span style="font-family: 宋体;">对象作为产品（</span>Product<span style="font-family: 宋体;">）。在具体建造者只有一个的情况下，如果抽象建造者角色已经被省略掉，那么还可以省略掉指导者角色。让</span>Builder<span style="font-family: 宋体;">角色自己扮演指导者与建造者双重角色。</span></p>
<p style="text-indent: 21pt;">&nbsp;</p>
<p style="text-indent: 21pt;"><span style="font-family: 宋体;">以下情况应当使用建造者模式：</span></p>
<p style="text-indent: 21pt;">1<span style="font-family: 宋体;">．需要生成的产品对象有复杂的内部结构。</span></p>
<p style="text-indent: 21pt;">2<span style="font-family: 宋体;">．需要生成的产品对象的属性相互依赖，建造者模式可以强迫生成顺序。</span></p>
<p style="text-indent: 21pt;">3<span style="font-family: 宋体;">．在对象创建过程中会使用到系统中的一些其它对象，这些对象在产品对象的创建过程中不易得到。</span></p>
<p>&nbsp;</p>
 <div id="EntryTag">Tag标签: <a href="http://www.cnblogs.com/guushuuse/tag/Pattern/">Pattern</a></div>
<div id="digg_block">
<div id="div_digg">										
	<div class="diggit" onclick="DiggIt(1458928,37209,1)"> 
		<span class="diggnum" id="digg_count_1458928">0</span>
	</div>
	<div class="buryit" onclick="DiggIt(1458928,37209,2)"> 
		<span class="burynum" id="bury_count_1458928">0</span>
	</div>
	<div class="clear"></div>
	<span style="display: none;" id="span_isdigged_1458928">0</span>	
	<div class="diggword" id="digg_word_1458928">(请您对文章做出评价)</div>	
</div>
</div>
<div class="clear"></div>
<div id="post_next_prev">
<a href="http://www.cnblogs.com/guushuuse/archive/2009/05/16/1458481.html">« </a> 上一篇：<a href="http://www.cnblogs.com/guushuuse/archive/2009/05/16/1458481.html" title="发布于2009-05-16 21:35">DotNet Framework源代码中的模式（七）——Factory Method（工厂模式）</a><br>
<a href="http://www.cnblogs.com/guushuuse/archive/2009/05/24/1488422.html">» </a> 下一篇：<a href="http://www.cnblogs.com/guushuuse/archive/2009/05/24/1488422.html" title="发布于2009-05-24 21:07">DotNet Framework源代码中的模式（九）——Flyweight（享元模式）</a><br>
</div>








		<p class="postfoot">
			posted on 2009-05-17 19:45 <a href="http://www.cnblogs.com/guushuuse/">guushuuse</a> 阅读(1494) <a href="#commentform">评论(3)</a> &nbsp;<a href="http://www.cnblogs.com/guushuuse/admin/EditPosts.aspx?postid=1458928">编辑</a> <a href="http://www.cnblogs.com/guushuuse/AddToFavorite.aspx?id=1458928">收藏</a> <a href="#" onclick="PutInWz();return false;">网摘</a>  所属分类: <a href="http://www.cnblogs.com/guushuuse/category/189705.html">53DotNet Framework源代码中的模式</a>
		</p>
	</div>
	<img src="1458928.html" height="1" width="1">
	
<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
<rdf:Description
rdf:about="http://www.cnblogs.com/guushuuse/archive/2009/05/17/1458928.html"
dc:identifier="http://www.cnblogs.com/guushuuse/archive/2009/05/17/1458928.html"
dc:title=""
trackback:ping="http://www.cnblogs.com/guushuuse/services/trackbacks/1458928.aspx" />
</rdf:RDF>
-->

	<a name="pagedcomment"></a>
<a name="评论">
</a><div id="comments">
<h3><a name="评论">评论</a></h3>
<a name="评论">	<span id="span_comment_maxid" style="display: none;">1537857</span>
	
			</a><h4>
<a name="评论">				</a><a href="#1531217">#1楼</a><a name="1531217" id="comment_anchor_1531217"></a>
					<span>
						2009-05-18 20:39
					</span>
				<a id="Comments1_CommentList_ctl00_NameLink" href="http://www.cnblogs.com/winter-cn/" target="_top">winter-cn</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/winter-cn" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</h4>
			<p>
				<span id="comment_body_1531217" class="blog_comment_body">此Builder非彼Builder
<br>楼主想法不错 但是不要硬靠</span>
				&nbsp;&nbsp;<a onclick='ReplyComment("winter-cn",1531217,"Pdws61x+NQ8fl9ARVs6LtT41joO9lQvJKu4mLDCcM+c3p9gdc2mSCQ==")' href="http://www.cnblogs.com/guushuuse/archive/2009/05/17/1458928.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1531217,"Pdws61x+NQ8fl9ARVs6LtT41joO9lQvJKu4mLDCcM+c3p9gdc2mSCQ==")' href="http://www.cnblogs.com/guushuuse/archive/2009/05/17/1458928.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=winter-cn" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl00_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl00$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl00_EditLink"></a>
			</p>
		
			<h4>
				<a href="#1532140">#2楼</a><a name="1532140" id="comment_anchor_1532140"></a>
					<span>
						2009-05-19 20:01
					</span>
				<a id="Comments1_CommentList_ctl01_NameLink" href="http://www.cnblogs.com/geyunfei/" target="_top">葛云飞</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e8%91%9b%e4%ba%91%e9%a3%9e" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</h4>
			<p>
				<span id="comment_body_1532140" class="blog_comment_body">这个。。
<br>内部是这样的吗？</span>
				&nbsp;&nbsp;<a onclick='ReplyComment("葛云飞",1532140,"ngb8tyBYBfO6zDnXIu0m7LchW8NO5rdKEuyIvOV4eamFH2UHE7EKKQ==")' href="http://www.cnblogs.com/guushuuse/archive/2009/05/17/1458928.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1532140,"ngb8tyBYBfO6zDnXIu0m7LchW8NO5rdKEuyIvOV4eamFH2UHE7EKKQ==")' href="http://www.cnblogs.com/guushuuse/archive/2009/05/17/1458928.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e8%91%9b%e4%ba%91%e9%a3%9e" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl01_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl01$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl01_EditLink"></a>
			</p>
		
			<h4>
				<a href="#1537857">#3楼</a><a name="1537857" id="comment_anchor_1537857"></a><a name="Post"></a>
					<span>
						2009-05-25 17:54
					</span>
				<a id="Comments1_CommentList_ctl02_NameLink" href="http://www.cnblogs.com/libinqi/" target="_top">李彬旗</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e6%9d%8e%e5%bd%ac%e6%97%97" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</h4>
			<p>
				<span id="comment_body_1537857" class="blog_comment_body">很好！我最近在学习设计模式，希望能一起讨论...</span>
				&nbsp;&nbsp;<a onclick='ReplyComment("李彬旗",1537857,"j3v17P07z3Tjydp+bIFVrfbK+n5aA62p19Kd/35g/zA8cdWgU7Vv4w==")' href="http://www.cnblogs.com/guushuuse/archive/2009/05/17/1458928.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1537857,"j3v17P07z3Tjydp+bIFVrfbK+n5aA62p19Kd/35g/zA8cdWgU7Vv4w==")' href="http://www.cnblogs.com/guushuuse/archive/2009/05/17/1458928.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e6%9d%8e%e5%bd%ac%e6%97%97" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl02_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl02$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl02_EditLink"></a>
			</p>
		
</div>

<div id="ctl05_comment_form" class="commentform">




<div id="ctl05_divLoginPannel">
<div class="login_tips">注册用户登录后才能发表评论，请 <a href="http://passport.cnblogs.com/login.aspx?ReturnUrl=http%3a%2f%2fwww.cnblogs.com%2fguushuuse%2farchive%2f2009%2f05%2f17%2f1458928.html%3flogin%3d1%23commentform" class="underline">登录</a> 或 <a href="http://passport.cnblogs.com/register.aspx?ReturnUrl=http%3a%2f%2fwww.cnblogs.com%2fguushuuse%2farchive%2f2009%2f05%2f17%2f1458928.html%23Bottom2" class="underline">注册</a> 。</div>
</div>

<div class="itnews c_ad_block" id="itnews">
<a href="http://news.cnblogs.com/" target="_top">IT新闻</a>:<br>

          ·  <a href="http://news.cnblogs.com/n/55140/" target="_top">《星际争霸2》"刀锋女王"重金属主题音乐视频</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55139/" target="_top">中国站长最郁闷的几件事情</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55138/" target="_top">苹果Vs谷歌：手机领域谁怕谁？</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55137/" target="_top">摩托罗拉：豪赌Android的希望与隐忧</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55136/" target="_top">分众新坐标：楼宇是过去 未来在手机和互联网</a><br>
	
</div>


<div id="ad_under_comment" class="c_ad_block">
<a href="http://a4.yeshj.com/rd/34138/" target="_top">每天10分钟，轻松学英语</a><br><br>
<div id="google_ads_div_cnblogs_blogpost_bottom1">
<iframe src="index_1.html" style="border: 0pt none ;" marginheight="0" marginwidth="0" name="google_ads_iframe_cnblogs_blogpost_bottom1" id="google_ads_iframe_cnblogs_blogpost_bottom1" scrolling="no" frameborder="0" height="60" width="468"></iframe></div>

<br>
<div id="google_ads_div_cnblogs_blogpost_bottom">
<iframe src="index_2.html" style="border: 0pt none ;" marginheight="0" marginwidth="0" name="google_ads_iframe_cnblogs_blogpost_bottom" id="google_ads_iframe_cnblogs_blogpost_bottom" scrolling="no" frameborder="0" height="250" width="300"></iframe></div>

</div>
<div id="site_nav_under" class="c_ad_block">
网站导航：<br>
<a href="http://www.cnblogs.com/" target="_top">博客园首页</a> &nbsp;<a href="http://news.cnblogs.com/" target="_top">IT新闻</a> &nbsp;<a href="http://home.cnblogs.com/" target="_top">个人主页</a> &nbsp;<a href="http://home.cnblogs.com/ing/" target="_top">闪存</a> &nbsp;<a href="http://job.cnblogs.com/" target="_top">程序员招聘</a> &nbsp;<a href="http://space.cnblogs.com/" target="_top">社区</a> &nbsp;<a href="http://space.cnblogs.com/q/" target="_top">博问</a> &nbsp;<a href="http://wz.cnblogs.com/" target="_top">网摘</a>
</div>
<div id="ad_under_comment2" class="c_ad_block">
<a href="http://www.china-pub.com/STATIC07/0912/zh_ndcx_091212.asp" target="_top"><img src="chinapub_20091222.jpg" alt="" style="border: 0px none ;"></a><br>
<a href="http://www.china-pub.com/itbook/" target="_top">China-pub 计算机图书网上专卖店！6.5万品种2-8折！</a><br>
<a href="http://www.china-pub.com/static07/0901/zh_jueba_090121.asp" target="_top">China-Pub 计算机绝版图书按需印刷服务</a><br>
</div>

<div id="HistoryToday" class="c_ad_block">
<b>历史上的今天:</b><br>

2008-05-17 <a href="http://www.cnblogs.com/guushuuse/archive/2008/05/17/1201580.html">ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(二十五)——第4章权限子系统（18） </a><br>

2008-05-17 <a href="http://www.cnblogs.com/guushuuse/archive/2008/05/17/1201577.html">ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(二十四)——第4章权限子系统（17） </a><br>

2008-05-17 <a href="http://www.cnblogs.com/guushuuse/archive/2008/05/17/1201575.html">ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(二十三)——第4章权限子系统（16） </a><br>

2008-05-17 <a href="http://www.cnblogs.com/guushuuse/archive/2008/05/17/1201573.html">ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(二十二)——第4章权限子系统（15）</a><br>

2008-05-17 <a href="http://www.cnblogs.com/guushuuse/archive/2008/05/17/1201529.html">ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(二十一)——第4章权限子系统（14） </a><br>

2008-05-17 <a href="http://www.cnblogs.com/guushuuse/archive/2008/05/17/1201505.html">ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(二十)——第4章权限子系统（13） </a><br>

2008-05-17 <a href="http://www.cnblogs.com/guushuuse/archive/2008/05/17/1201503.html">ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(十九)——第4章权限子系统（12）</a><br>

2008-05-17 <a href="http://www.cnblogs.com/guushuuse/archive/2008/05/17/1201495.html">ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(十八)——第4章权限子系统（11） </a><br>

2008-05-17 <a href="http://www.cnblogs.com/guushuuse/archive/2008/05/17/1201417.html">ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(十七)——第4章权限子系统（10） </a><br>

2008-05-17 <a href="http://www.cnblogs.com/guushuuse/archive/2008/05/17/1201416.html">ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(十五)——第4章权限子系统（8） </a><br>

2008-05-17 <a href="http://www.cnblogs.com/guushuuse/archive/2008/05/17/1201415.html">ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(十六)——第4章权限子系统（9） </a><br>

2008-05-17 <a href="http://www.cnblogs.com/guushuuse/archive/2008/05/17/1201410.html">ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(十四)——第4章权限子系统（7） </a><br>

2008-05-17 <a href="http://www.cnblogs.com/guushuuse/archive/2008/05/17/1201406.html">ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(十三)——第4章权限子系统（6） </a><br>

2008-05-17 <a href="http://www.cnblogs.com/guushuuse/archive/2008/05/17/1201402.html">ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(十二)——第4章权限子系统（5）</a><br>

2008-05-17 <a href="http://www.cnblogs.com/guushuuse/archive/2008/05/17/1201382.html">ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(十一)——第4章权限子系统（4） </a><br>

2008-05-17 <a href="http://www.cnblogs.com/guushuuse/archive/2008/05/17/1201381.html">ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(十)——第4章权限子系统（3） </a><br>

2008-05-17 <a href="http://www.cnblogs.com/guushuuse/archive/2008/05/17/1201380.html">ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(九)——第4章权限子系统（2） </a><br>

</div>
<div id="relative_search"><br><b>相关搜索:</b><br> <a href="http://zzk.cnblogs.com/s?w=Pattern" target="_top">Pattern</a> <a href="http://zzk.cnblogs.com/s?w=53DotNet+Framework%e6%ba%90%e4%bb%a3%e7%a0%81%e4%b8%ad%e7%9a%84%e6%a8%a1%e5%bc%8f" target="_top">53DotNet Framework源代码中的模式</a> </div><div id="relative_search"><br><b>在知识库中查看：</b><br> <a href="http://kb.cnblogs.com/a/1458928/">DotNet Framework源代码中的模式（八）——Builder（生成器模式）</a></div>

</div>


				
			</div>
			<div id="rightmenu">
				
					
<h3>导航</h3>
<ul>
			<li><a id="MyLinks1_HomeLink" href="http://www.cnblogs.com/">博客园</a></li>
			<li><a id="MyLinks1_MyHomeLink" href="http://www.cnblogs.com/guushuuse/">首页</a></li>
			<li><a id="MyLinks1_NewPostLink" href="http://www.cnblogs.com/guushuuse/admin/EditPosts.aspx?opt=1">新随笔</a></li>
			<li><a id="MyLinks1_ContactLink" accesskey="9" href="http://space.cnblogs.com/msg/send/guushuuse">联系</a></li>
			<li><a id="MyLinks1_Syndication" href="http://www.cnblogs.com/guushuuse/rss">订阅</a><a id="MyLinks1_XMLLink" href="http://www.cnblogs.com/guushuuse/rss"><img src="xml.gif" alt="订阅" style="border-width: 0px;"></a>
			</li><li><a id="MyLinks1_Admin" href="http://www.cnblogs.com/guushuuse/admin/EditPosts.aspx">管理</a></li>
</ul>
					
<h3>统计</h3>
	<ul>
		<li>随笔 - 85
		</li><li>文章 - 0
		</li><li>评论 - 188
		</li><li>引用 - 18
	</li>
</ul>
					
<div class="newsItem">
<h3>公告</h3>
<div style="overflow: scroll; width: 200px; height: 200px;"><a id="map-5adbb343-f959-4928-ac8e-7fd8f9433b2b" title="单击可在 Live.com 上查看此地图" href="http://maps.live.com/default.aspx?v=2&amp;cp=31.55747%7E120.358&amp;lvl=10&amp;style=r&amp;mkt=en-us&amp;FORM=LLWR" alt="单击可在 Live.com 上查看此地图" target="_top"><img alt="无锡地图" src="wuix_map_1.jpg" border="0" height="374" width="363"></a></div><div id="profile_block"><a href="http://home.cnblogs.com/guushuuse/" target="_top">我的主页</a>&nbsp; <a href="http://home.cnblogs.com/guushuuse/detail/" target="_top">个人资料</a><br><a href="http://home.cnblogs.com/guushuuse/ing/" target="_top">我的闪存</a>&nbsp; <a href="http://space.cnblogs.com/msg/send/guushuuse" target="_top">发短消息</a></div>
</div>

					

<div class="mySearch">
<h3 class="catListTitle">搜索</h3>
<div class="div_my_zzk"><input value="" id="q" onkeydown="return zzk_go_enter(event);" class="input_my_zzk" type="text">&nbsp;<input onclick="zzk_go()" value="找找看" id="btnZzk" class="btn_my_zzk" type="button"></div>
</div>
<h3>常用链接</h3>
<ul>

		<li><a id="SingleColumn1_ctl02_rptMainLinks_ctl00_lnkLinkItem" href="http://www.cnblogs.com/guushuuse/MyPosts.html">我的随笔</a></li>
	
		<li><a id="SingleColumn1_ctl02_rptMainLinks_ctl01_lnkLinkItem" href="http://home.cnblogs.com/guushuuse/">我的空间</a></li>
	
		<li><a id="SingleColumn1_ctl02_rptMainLinks_ctl02_lnkLinkItem" href="http://space.cnblogs.com/msg/recent">我的短信</a></li>
	
		<li><a id="SingleColumn1_ctl02_rptMainLinks_ctl03_lnkLinkItem" href="http://www.cnblogs.com/guushuuse/MyComments.html">我的评论</a></li>
	
<li><a id="itemListLink" onclick="this.blur();WarpClass('itemListLink', 'itemListLin_con');return false;" href="#">更多链接</a></li>
</ul>
<div id="itemListLin_con" style="display: none;">
<ul>
		<li><a id="SingleColumn1_ctl02_repeaterLinks_ctl01_lnkLinkItem" title="我发表过评论的随笔" href="http://www.cnblogs.com/guushuuse/OtherPosts.html">我的参与</a></li>
	
		<li><a id="SingleColumn1_ctl02_repeaterLinks_ctl02_lnkLinkItem" href="http://www.cnblogs.com/guushuuse/MyNews.html">我的新闻</a></li>
	
		<li><a id="SingleColumn1_ctl02_repeaterLinks_ctl03_lnkLinkItem" href="http://www.cnblogs.com/guushuuse/RecentComments.html">最新评论</a></li>
	
		<li><a id="SingleColumn1_ctl02_repeaterLinks_ctl04_lnkLinkItem" href="http://www.cnblogs.com/guushuuse/tag/">我的标签</a></li>
	</ul>
</div>

<h3 class="catListTitle">我的标签</h3>
<div id="MyTag">
<ul>
<li><a href="http://www.cnblogs.com/guushuuse/tag/ASP.NET/">ASP.NET</a>(28)</li><li><a href="http://www.cnblogs.com/guushuuse/tag/NHibernate/">NHibernate</a>(26)</li><li><a href="http://www.cnblogs.com/guushuuse/tag/Spring.NET/">Spring.NET</a>(26)</li><li><a href="http://www.cnblogs.com/guushuuse/tag/ASP.NET+AJAX/">ASP.NET AJAX</a>(26)</li><li><a href="http://www.cnblogs.com/guushuuse/tag/SSO/">SSO</a>(13)</li><li><a href="http://www.cnblogs.com/guushuuse/tag/Pattern/">Pattern</a>(10)</li>
</ul>
</div>
		<h3>随笔分类</h3>
		
				<ul>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl01_Link" href="http://www.cnblogs.com/guushuuse/category/135488.html">01术语(29)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl01_RssLink" title="Subscribe to 01术语(29)" href="http://www.cnblogs.com/guushuuse/category/135488.html/rss">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl02_Link" href="http://www.cnblogs.com/guushuuse/category/188547.html">02知识点(2)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl02_RssLink" title="Subscribe to 02知识点(2)" href="http://www.cnblogs.com/guushuuse/category/188547.html/rss">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl03_Link" href="http://www.cnblogs.com/guushuuse/category/136779.html">03FAQ(3)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl03_RssLink" title="Subscribe to 03FAQ(3)" href="http://www.cnblogs.com/guushuuse/category/136779.html/rss">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl04_Link" href="http://www.cnblogs.com/guushuuse/category/188680.html">11.NET Framework</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl04_RssLink" title="Subscribe to 11.NET Framework" href="http://www.cnblogs.com/guushuuse/category/188680.html/rss">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl05_Link" href="http://www.cnblogs.com/guushuuse/category/188681.html">12C#</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl05_RssLink" title="Subscribe to 12C#" href="http://www.cnblogs.com/guushuuse/category/188681.html/rss">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl06_Link" href="http://www.cnblogs.com/guushuuse/category/188561.html">13ASP.NET(2)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl06_RssLink" title="Subscribe to 13ASP.NET(2)" href="http://www.cnblogs.com/guushuuse/category/188561.html/rss">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl07_Link" href="http://www.cnblogs.com/guushuuse/category/223074.html">51技术文章</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl07_RssLink" title="Subscribe to 51技术文章" href="http://www.cnblogs.com/guushuuse/category/223074.html/rss">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl08_Link" href="http://www.cnblogs.com/guushuuse/category/135487.html">52ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(26)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl08_RssLink" title="Subscribe to 52ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(26)" href="http://www.cnblogs.com/guushuuse/category/135487.html/rss">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl09_Link" href="http://www.cnblogs.com/guushuuse/category/189705.html">53DotNet Framework源代码中的模式(9)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl09_RssLink" title="Subscribe to 53DotNet Framework源代码中的模式(9)" href="http://www.cnblogs.com/guushuuse/category/189705.html/rss">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl10_Link" href="http://www.cnblogs.com/guushuuse/category/223085.html">54.轻量级单点登录系统最佳实践_V2</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl10_RssLink" title="Subscribe to 54.轻量级单点登录系统最佳实践_V2" href="http://www.cnblogs.com/guushuuse/category/223085.html/rss">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl11_Link" href="http://www.cnblogs.com/guushuuse/category/187644.html">54轻量级单点登录系统最佳实践(13)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl11_RssLink" title="Subscribe to 54轻量级单点登录系统最佳实践(13)" href="http://www.cnblogs.com/guushuuse/category/187644.html/rss">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl12_Link" href="http://www.cnblogs.com/guushuuse/category/223083.html">55Visual Studio International Pack应用</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl12_RssLink" title="Subscribe to 55Visual Studio International Pack应用" href="http://www.cnblogs.com/guushuuse/category/223083.html/rss">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl13_Link" href="http://www.cnblogs.com/guushuuse/category/223084.html">56Chart Controls for .NET Framework应用</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl13_RssLink" title="Subscribe to 56Chart Controls for .NET Framework应用" href="http://www.cnblogs.com/guushuuse/category/223084.html/rss">(rss)</a></li>
			
				</ul>
			
	
		<h3>随笔档案</h3>
		
				<ul>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl01_Link" href="http://www.cnblogs.com/guushuuse/archive/2009/05.html">2009年5月 (31)</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl02_Link" href="http://www.cnblogs.com/guushuuse/archive/2009/04.html">2009年4月 (13)</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl03_Link" href="http://www.cnblogs.com/guushuuse/archive/2008/05.html">2008年5月 (41)</a> </li>
			
				</ul>
			
	
		<h3>收藏夹</h3>
		
				<ul>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl01_Link" href="http://www.cnblogs.com/guushuuse/favorite/224492.html">01.Net(3)</a> <a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl01_RssLink" title="Subscribe to 01.Net(3)" href="http://www.cnblogs.com/guushuuse/favorite/224492.html/rss">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl02_Link" href="http://www.cnblogs.com/guushuuse/favorite/223092.html">09Tools(2)</a> <a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl02_RssLink" title="Subscribe to 09Tools(2)" href="http://www.cnblogs.com/guushuuse/favorite/223092.html/rss">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl03_Link" href="http://www.cnblogs.com/guushuuse/favorite/224471.html">51项目</a> <a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl03_RssLink" title="Subscribe to 51项目" href="http://www.cnblogs.com/guushuuse/favorite/224471.html/rss">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl04_Link" href="http://www.cnblogs.com/guushuuse/favorite/224472.html">52项目-Network(3)</a> <a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl04_RssLink" title="Subscribe to 52项目-Network(3)" href="http://www.cnblogs.com/guushuuse/favorite/224472.html/rss">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl05_Link" href="http://www.cnblogs.com/guushuuse/favorite/224473.html">53项目-CMS</a> <a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl05_RssLink" title="Subscribe to 53项目-CMS" href="http://www.cnblogs.com/guushuuse/favorite/224473.html/rss">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl06_Link" href="http://www.cnblogs.com/guushuuse/favorite/224474.html">54项目-Edit(20)</a> <a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl06_RssLink" title="Subscribe to 54项目-Edit(20)" href="http://www.cnblogs.com/guushuuse/favorite/224474.html/rss">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl07_Link" href="http://www.cnblogs.com/guushuuse/favorite/224494.html">55项目-SSO(2)</a> <a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl07_RssLink" title="Subscribe to 55项目-SSO(2)" href="http://www.cnblogs.com/guushuuse/favorite/224494.html/rss">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl08_Link" href="http://www.cnblogs.com/guushuuse/favorite/224532.html">56项目-MIS(5)</a> <a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl08_RssLink" title="Subscribe to 56项目-MIS(5)" href="http://www.cnblogs.com/guushuuse/favorite/224532.html/rss">(rss)</a></li>
			
				</ul>
			
	
		<h3>01技术网站</h3>
		
				<ul>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl01_Link" href="http://www.ibm.com/developerworks/cn/" target="_top">developerWorks 中国</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl02_Link" href="http://www.infoq.com/" target="_top">InfoQ</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl03_Link" href="http://sourceforge.net/" target="_top">SourceForge.net</a> </li>
			
				</ul>
			
	
		<h3>07技术网站</h3>
		
				<ul>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl04_LinkList_ctl01_Link" href="http://www.connectionstrings.com/" target="_top">ConnectionStrings</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl04_LinkList_ctl02_Link" href="http://www.regxlib.net/" target="_top">RegExLib</a> </li>
			
				</ul>
			
	
		<h3>11.NET</h3>
		
				<ul>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl01_Link" href="http://www.dotnet247.com/" target="_top">.NET 247</a> <a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl01_RssLink" title="Subscribe to .NET 247" href="http://www.dotnet247.com/247reference/rss.aspx?t=site">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl02_Link" href="http://www.123aspx.com/">123aspx</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl03_Link" href="http://4guysfromrolla.com/" target="_top">4GuysFromRolla.com</a> <a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl03_RssLink" title="Subscribe to 4GuysFromRolla.com" href="http://aspnet.4guysfromrolla.com/rss/rss.aspx">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl04_Link" href="http://aspalliance.com/" target="_top">ASP Alliance</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl05_Link" href="http://www.asp.net/" target="_top">ASP.NET</a> <a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl05_RssLink" title="Subscribe to ASP.NET" href="http://www.asp.net/community/articles/rss.ashx">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl06_Link" href="http://www.c-sharpcorner.com/" target="_top">C# Corner </a> <a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl06_RssLink" title="Subscribe to C# Corner " href="http://www.c-sharpcorner.com/Rss/LatestArticles.aspx">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl07_Link" href="http://www.csharphelp.com/" target="_top">C# Help</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl08_Link" href="http://channel9.msdn.com/" target="_top">Channel 9</a> <a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl08_RssLink" title="Subscribe to Channel 9" href="http://channel9.msdn.com/Feeds/RSS/">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl09_Link" href="http://www.codeguru.com/" target="_top">CodeGuru</a> <a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl09_RssLink" title="Subscribe to CodeGuru" href="http://www.codeguru.com/icom_includes/feeds/codeguru/rss-all.xml">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl10_Link" href="http://www.codeplex.com/" target="_top">CodePlex</a> <a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl10_RssLink" title="Subscribe to CodePlex" href="http://www.codeplex.com/rss.ashx">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl11_Link" href="http://www.codeproject.com/" target="_top">CodeProject</a> <a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl11_RssLink" title="Subscribe to CodeProject" href="http://www.codeproject.com/webservices/articlerss.aspx">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl12_Link" href="http://www.devsource.com/" target="_top">DevSource</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl13_Link" href="http://www.devx.com/" target="_top">DevX</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl14_Link" href="http://www.dotnetbips.com/" target="_top">DotNetBips</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl15_Link" href="http://www.eggheadcafe.com/" target="_top">EggHeadCafe</a> <a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl15_RssLink" title="Subscribe to EggHeadCafe" href="http://www.eggheadcafe.com/rss_pheedo.xml">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl16_Link" href="http://code.msdn.microsoft.com/" target="_top">MSDN Code Gallery</a> <a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl16_RssLink" title="Subscribe to MSDN Code Gallery" href="http://code.msdn.microsoft.com/rss.ashx">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl17_Link" href="http://msdn.microsoft.com/en-us/magazine/default.aspx" target="_top">MSDN Magazine</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl18_Link" href="http://windowsclient.net/" target="_top">WindowsClient.net</a> <a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl18_RssLink" title="Subscribe to WindowsClient.net" href="http://windowsclient.net/blogs/MainFeed.aspx?GroupID=5&amp;Type=AllBlogs">(rss)</a></li>
			
				</ul>
			
	
		<h3>15.NET开源</h3>
		
				<ul>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl06_LinkList_ctl01_Link" href="http://www.codeplex.com/AtlasControlToolkit/" target="_top">AJAX Control Toolkit</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl06_LinkList_ctl02_Link" href="http://aspnet.codeplex.com/Wiki/View.aspx?title=Image%20Generation&amp;referringTitle=Home" target="_top">ASP.NET Generated Image</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl06_LinkList_ctl03_Link" href="http://aspnet.codeplex.com/Wiki/View.aspx?title=MVC" target="_top">ASP.NET MVC</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl06_LinkList_ctl04_Link" href="http://netcommon.sourceforge.net/" target="_top">Common.Logging</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl06_LinkList_ctl05_Link" href="http://sourceforge.net/projects/dockpanelsuite/" target="_top">DockPanel Suite</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl06_LinkList_ctl06_Link" href="http://dotnetzip.codeplex.com/" target="_top">DotNetZip Library </a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl06_LinkList_ctl07_Link" href="http://www.filehelpers.com/" target="_top">FileHelpers</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl06_LinkList_ctl08_Link" href="http://www.codeplex.com/htmlagilitypack" target="_top">Html Agility Pack</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl06_LinkList_ctl09_Link" href="http://itextsharp.sourceforge.net/" target="_top">iTextSharp</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl06_LinkList_ctl10_Link" href="http://logging.apache.org/log4net/" target="_top">log4net</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl06_LinkList_ctl11_Link" href="http://incubator.apache.org/lucene.net/" target="_top">Lucene.Net </a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl06_LinkList_ctl12_Link" href="http://www.nhibernate.org/" target="_top">NHibernate</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl06_LinkList_ctl13_Link" href="http://quartznet.sourceforge.net/" target="_top">Quartz.NET</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl06_LinkList_ctl14_Link" href="http://www.codeplex.com/SharpMap/" target="_top">SharpMap</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl06_LinkList_ctl15_Link" href="http://www.icsharpcode.net/OpenSource/SharpZipLib/" target="_top">SharpZipLib</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl06_LinkList_ctl16_Link" href="http://www.springframework.net/" target="_top">Spring.NET</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl06_LinkList_ctl17_Link" href="http://www.stringtemplate.org/" target="_top">StringTemplate</a> </li>
			
				</ul>
			
	
		<h3>16.NET开源</h3>
		
				<ul>
			
				</ul>
			
	
		<h3>18.NET博客</h3>
		
				<ul>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl08_LinkList_ctl01_Link" href="http://weblogs.asp.net/scottgu/" target="_top">ScottGu's Blog</a> <a id="SingleColumn1_Categories_CatList_ctl08_LinkList_ctl01_RssLink" title="Subscribe to ScottGu's Blog" href="http://weblogs.asp.net/scottgu/rss.aspx">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl08_LinkList_ctl02_Link" href="http://blog.joycode.com/" target="_top">博客堂</a> </li>
			
				</ul>
			
	
		<h3>81其他</h3>
		
				<ul>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl09_LinkList_ctl01_Link" href="http://www.chinaunix.net/" target="_top">ChinaUnix.net</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl09_LinkList_ctl02_Link" href="http://www.csdn.net/" target="_top">CSDN</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl09_LinkList_ctl03_Link" href="http://www.db2china.net/" target="_top">IBM DB2数据库专业网站 </a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl09_LinkList_ctl04_Link" href="http://www.itpub.net/" target="_top">ITPUB</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl09_LinkList_ctl05_Link" href="http://www.mydb2.cn/" target="_top">MYDB2.CN</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl09_LinkList_ctl06_Link" href="http://www.eimhe.com/" target="_top">美河学习在线</a> </li>
			
				</ul>
			
	
		<h3>82其他</h3>
		
				<ul>
			
				</ul>
			
	
		<h3>99友情链接</h3>
		
				<ul>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl11_LinkList_ctl01_Link" href="http://www.cnblogs.com/xugang">xugang</a> </li>
			
				</ul>
			
	

<h3>积分与排名</h3>
<ul>
	<li>
		积分 -
		72091
	</li><li>
		排名 -
		1017
	</li>
</ul>

<h3 class="catListTitle">最新评论
	<a id="SingleColumn1__2e3d8b6_RSSHyperlink1" href="http://www.cnblogs.com/guushuuse/CommentsRSS.aspx"><img src="xml.gif" style="border-width: 0px;"></a></h3>
<div class="RecentComment" id="RecentComments">
	
			<ul>
		
			<li style="">
				<a id="SingleColumn1__2e3d8b6_CommentList_ctl01_Hyperlink1" href="http://www.cnblogs.com/guushuuse/archive/2009/05/03/1448040.html#1716767">1.&nbsp;Re:C#设计模式手册_V1.0</a>
			</li>
			<li style="">
				非常不错！
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--心情预约</li>
		
			<li style="">
				<a id="SingleColumn1__2e3d8b6_CommentList_ctl02_Hyperlink1" href="http://www.cnblogs.com/guushuuse/archive/2008/05/10/1190995.html#1662802">2.&nbsp;Re:ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(二)——第1章前言</a>
			</li>
			<li style="">
				23wewe
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--fwf</li>
		
			<li style="">
				<a id="SingleColumn1__2e3d8b6_CommentList_ctl03_Hyperlink1" href="http://www.cnblogs.com/guushuuse/archive/2009/05/04/1449012.html#1645608">3.&nbsp;Re:轻量级单点登录系统最佳实践(四)——第3章 Web-SSO通常实现方式</a>
			</li>
			<li style="">
				沙发
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--海洋之 心</li>
		
			<li style="">
				<a id="SingleColumn1__2e3d8b6_CommentList_ctl04_Hyperlink1" href="http://www.cnblogs.com/guushuuse/archive/2009/05/04/1449011.html#1645606">4.&nbsp;Re:轻量级单点登录系统最佳实践(三)——第2章 单点登录简介</a>
			</li>
			<li style="">
				沙发
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--海洋之 心</li>
		
			<li style="">
				<a id="SingleColumn1__2e3d8b6_CommentList_ctl05_Hyperlink1" href="http://www.cnblogs.com/guushuuse/archive/2009/05/04/1449027.html#1645605">5.&nbsp;Re:轻量级单点登录系统最佳实践(七)——5.2. 单点登录系统SSOLab.SSOServer.WebApp</a>
			</li>
			<li style="">
				沙发
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--海洋之 心</li>
		
			</ul>
		
</div>

<h3 class="catListTitle">阅读排行榜</h3>
<div class="RecentComment" id="TopViewPosts"> 
	
			<ul style="">
		
			<li>
				<a id="SingleColumn1_ctl07_TopList_ctl01_Hyperlink1" href="http://www.cnblogs.com/guushuuse/archive/2008/05/21/1201890.html">1.&nbsp;ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(八)——第4章权限子系统（1） (3788)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl07_TopList_ctl02_Hyperlink1" href="http://www.cnblogs.com/guushuuse/archive/2008/05/22/1203708.html">2.&nbsp;ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(二十六)——第4章权限子系统（19）权限子系统小结 (3355)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl07_TopList_ctl03_Hyperlink1" href="http://www.cnblogs.com/guushuuse/archive/2009/05/04/1449074.html">3.&nbsp;轻量级单点登录系统最佳实践(2805)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl07_TopList_ctl04_Hyperlink1" href="http://www.cnblogs.com/guushuuse/archive/2008/05/10/1191417.html">4.&nbsp;ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(四)——第3章人事子系统（1）(2788)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl07_TopList_ctl05_Hyperlink1" href="http://www.cnblogs.com/guushuuse/archive/2008/05/10/1191231.html">5.&nbsp;ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(三)——第2章环境准备(2757)</a>
			</li>
		
			</ul>
		
</div>

<h3 class="catListTitle">评论排行榜</h3>
<div class="RecentComment" id="TopCommentsPosts">
	
			<ul style="">
		
			<li>
				<a id="SingleColumn1_ctl08_TopList_ctl01_Hyperlink1" href="http://www.cnblogs.com/guushuuse/archive/2009/05/04/1449074.html">1.&nbsp;轻量级单点登录系统最佳实践(19)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl08_TopList_ctl02_Hyperlink1" href="http://www.cnblogs.com/guushuuse/archive/2008/05/20/1203278.html">2.&nbsp;Agile Software Development（敏捷软件开发）(17)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl08_TopList_ctl03_Hyperlink1" href="http://www.cnblogs.com/guushuuse/archive/2008/05/22/1203708.html">3.&nbsp;ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(二十六)——第4章权限子系统（19）权限子系统小结 (12)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl08_TopList_ctl04_Hyperlink1" href="http://www.cnblogs.com/guushuuse/archive/2008/05/10/1191231.html">4.&nbsp;ASP.NET&amp;Spring.NET&amp;NHibernate最佳实践(三)——第2章环境准备(12)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl08_TopList_ctl05_Hyperlink1" href="http://www.cnblogs.com/guushuuse/archive/2009/05/11/1454464.html">5.&nbsp;DotNet Framework源代码中的模式（四）——Abstract Factory（抽象工厂模式）(11)</a>
			</li>
		
			</ul>
		
</div>
				
			</div>			
			
<p id="footer">
	Powered by: 
	<br>
	
	<a id="Footer1_Hyperlink3" name="Hyperlink1" href="http://www.cnblogs.com/" style="font-family: Verdana; font-size: 12px;">博客园</a>
	<br>
	Copyright © guushuuse
</p>
	

    </form>
	
	
      
    
    
    
</body>
</html>
